program BPlis2xml;
{$mode objfpc}{$H+}
uses BPlist;

begin
  if (ParamCount = 3) or (ParamCount = 1) then
  begin
    if ParamStr(1) = '-about' then
    begin
     writeln('BPlis2xml v0.1');
     writeln('Conversion from Apple binary plist format to XML plist');
     writeln('Copyright (c) 2011, Alexey Dolgopolov');
     writeln('All rights reserved');
    end
    else
    if (ParamStr(1) = '-c') and (ParamCount = 3) then
    begin
       if not BinaryToXML(ParamStr(2),ParamStr(3)) then
        writeln('Error: Unable convert file ',ParamStr(2));
    end
    else
    begin
      writeln('Usage:');
      writeln('-about ');
      writeln('-c [input] [output]');
    end;
  end
  else
  begin
    writeln('Usage:');
    writeln('-about ');
    writeln('-c [input] [output]');
  end;
end.